<pre>
<?php

$block = array('ins'=>1, 'del'=>1, 'p'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'ul'=>1, 'ol'=>1, 'dir'=>1, 'menu'=>1, 'dl'=>1, 'pre'=>1, 'div'=>1, 'center'=>1, 'blockquote'=>1, 'iframe'=>1, 'noscript'=>1, 'noframes'=>1, 'form'=>1, 'isindex'=>1, 'hr'=>1, 'table'=>1, 'address'=>1, 'fieldset'=>1);
$inline = array('ins'=>1, 'del'=>1, 'tt'=>1, 'i'=>1, 'b'=>1, 'u'=>1, 's'=>1, 'strike'=>1, 'big'=>1, 'small'=>1, 'font'=>1, 'em'=>1, 'strong'=>1, 'dfn'=>1, 'code'=>1, 'samp'=>1, 'kbd'=>1, 'var'=>1, 'cite'=>1, 'abbr'=>1, 'acronym'=>1, 'sub'=>1, 'sup'=>1, 'q'=>1, 'span'=>1, 'bdo'=>1, 'a'=>1, 'object'=>1, 'applet'=>1, 'img'=>1, 'basefont'=>1, 'br'=>1, 'script'=>1, 'map'=>1, 'input'=>1, 'select'=>1, 'textarea'=>1, 'label'=>1, 'button'=>1);

$el = array(
    'html' => array('head'=>1, 'body'=>1),
    'head' => array('title'=>1, 'base'=>1, 'script'=>1, 'style'=>1, 'isindex'=>1, 'meta'=>1, 'link'=>1, 'object'=>1),
    'title' => array('%DATA'=>1),
    'script' => array('%DATA'=>1),
    'style' => array('%DATA'=>1),
    'body' => $block + $inline,
    'p' => $inline,
    'h1' => $inline,
    'h2' => $inline,
    'h3' => $inline,
    'h4' => $inline,
    'h5' => $inline,
    'h6' => $inline,
    'ul' => array('li'=>1),
    'ol' => array('li'=>1),
    'li' => $block + $inline,
    'dir' => array('li'=>1),
    'menu' => array('li'=>1), // inline-li
    'dl' => array('dt'=>1, 'dd'=>1),
    'dt' => $inline,
    'dd' => $block + $inline,
    'pre' => array_flip(array_diff(array_keys($inline), array('img','object','applet','big','small','sub','sup','font','basefont'))),
    'div' => $block + $inline,
    'center' => $block + $inline,
    'blockquote' => $block + $inline,
    'iframe' => $block + $inline,
    'noscript' => $block + $inline,
    'noframes' => $block + $inline,
    'form' => $block + $inline,
    'table' => array('caption'=>1, 'colgroup'=>1, 'col'=>1, 'thead'=>1, 'tbody'=>1, 'tfoot'=>1, 'tr'=>1),
    'caption' => $inline,
    'colgroup' => array('col'=>1),
    'thead' => array('tr'=>1),
    'tbody' => array('tr'=>1),
    'tfoot' => array('tr'=>1),
    'tr' => array('td'=>1, 'th'=>1),
    'td' => $block + $inline,
    'th' => $block + $inline,
    'address' => array('p'=>1) + $inline,
    'fieldset' => array('legend'=>1) + $block + $inline,
    'legend' => $inline,
    'tt' => $inline,
    'i' => $inline,
    'b' => $inline,
    'u' => $inline,
    's' => $inline,
    'strike' => $inline,
    'big' => $inline,
    'small' => $inline,
    'font' => $inline,
    'em' => $inline,
    'strong' => $inline,
    'dfn' => $inline,
    'code' => $inline,
    'samp' => $inline,
    'kbd' => $inline,
    'var' => $inline,
    'cite' => $inline,
    'abbr' => $inline,
    'acronym' => $inline,
    'sub' => $inline,
    'sup' => $inline,
    'q' => $inline,
    'span' => $inline,
    'bdo' => $inline,
    'a' => $inline,
    'object' => array('param'=>1) + $block + $inline,
    'applet' => array('param'=>1) + $block + $inline,
    'map' => array('area'=>1) + $block,
    'select' => array('option'=>1, 'optgroup'=>1),
    'optgroup' => array('option'=>1),
    'option' => array('%DATA'=>1),
    'textarea' => array('%DATA'=>1),
    'label' => $inline, // minus label
    'button' => $block + $inline, // minus input select textarea label button form fieldset
    'ins' => FALSE, // special
    'del' => FALSE, // special
    // empty
    'img' => FALSE,
    'hr' => FALSE,
    'br' => FALSE,
    'input' => FALSE,
    'meta' => FALSE,
    'area' => FALSE,
    'base' => FALSE,
    'col' => FALSE,
    'link' => FALSE,
    'param' => FALSE,
    'basefont' => FALSE,
    'frame' => FALSE,
    'isindex' => FALSE,
);

print_r($el);
